package com.briup.springboot_web.web.controller;

import com.briup.springboot_web.bean.Teacher;
import com.briup.springboot_web.util.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;
import java.util.Date;

@Api(tags = "教师管理模块")
@RestController
@RequestMapping("/teacher")
public class TeacherController {
    @ApiOperation("根据工号查询教师信息")
    @GetMapping
    public Response findById(Integer id){
        //Teacher t = new Teacher(1, "jack", new Date());
        Teacher t = new Teacher(1, "jack", LocalDateTime.now());
        return Response.success(t);
    }
    @PostMapping
    public Response addTeacher(@RequestBody Teacher t){
        System.out.println(t);
        return Response.success();
    }
}
